<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{content.title}}</title>
    <link rel="stylesheet" href="/public/main.css">
    <script src="/public/js/jq3.0.0.min.js"></script>
    <script src="/public/js/axios.min.js"></script>
    <script src="/public/js/public.js"></script>
</head>
<body>
    <div class="main">

        <div class="blog-navigate">
            <div class="blog-container clear">
                <div class="row-item-s">
                    <span class="user-info" id="userName">
                        用户名：{{userinfo.username}}
                    </span>
                    <span class="user-info" id="userId">
                        用户id：{{userinfo._id}}
                    </span>
                    {% if userinfo.isAdmin %}
                    <span class="user-info">
                        权限：管理员用户
                    </span>
                    <div class="user-info-btn user-info">
                        <a href="/admin" class="btn-x">进入后台</a>
                    </div>

                    {% else %}
                    <span class="user-info">
                        权限：普通用户
                    </span>
                    {% endif %}
                    <div class="user-info-btn">
                        <input type="button" class="btn-x" value="退出" id="login_out">
                    </div>
                </div>
            </div>
        </div>

        <div class="blog-container">
            <!--
            <div class="blog-header-box">
                {%if !content.category%}
                <a class="blog-header-item active" href="/">
                    首页
                </a>
                {%else%}
                <a class="blog-header-item" href="/">
                    首页
                </a>
                {%endif%}

                {% for item in typelist %}
                    {%if content.category===item._id.toString()%}
                    <a class="blog-header-item active" href="/?category={{item._id.toString()}}">
                        {{item.name.toString()}}
                    </a>
                    {%else%}
                    <a class="blog-header-item" href="/?category={{item._id.toString()}}">
                        {{item.name.toString()}}
                    </a>
                    {%endif%}
                {% endfor %}
            </div>
            -->
            <div class="blog-content">
                <div class="blog-content-grp">
                    <div class="blog-content-h">
                        {{content.title}}
                    </div>
                    <span>简介：{{content.distribution}}</span><span>作者：{{content.user.username}}</span><span>时间：{{content.addTime|date('Y年m月d日 h:i:s',-8*60)}}</span>
                    <div>分类：{{content.category.name}}</div>
                    <div class="blog-content-txt">内容：{{content.content}}</div>
                    <div>阅读量：{{content.views}}</div>
                </div>
            </div>
        </div>

        <div class="blog-container">
            <div class="blog-content">

                {% if userinfo._id %}
<!--                <form action="post">-->
<!--                    <div class="box">-->
<!--                        <label for="content">评论</label>-->
<!--                        <div>-->
<!--                            <textarea id="content" name="content" cols="80" rows="10" placeholder="请输入评论内容"></textarea>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                    <div class="blog-submit-grp">-->
<!--                        <button type="submit" name="submit" id="tj" class="btn-x">评论提交</button>-->
<!--                    </div>-->
<!--                </form>-->
                <div class="box">
                    <label for="content">评论</label>
                    <div>
                        <textarea id="content" name="content" cols="80" rows="10" placeholder="请输入评论内容"></textarea>
                    </div>
                </div>
                <div class="blog-submit-grp">
                    <button type="submit" name="submit" id="tj" class="btn-x">评论提交</button>
                </div>
                {%else%}
                <div class="">
                    请登录
                </div>
                {%endif%}


                <div class="blog-comment">
                    <h3>往期评论</h3>
                    <ul class="blog-comment-row">
                        <li class="blog-comment-list">111</li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
    <script>
        $('#tj').on('click',function () {

        })
    </script>
</body>
</html>
